<?php

class admin_Form_Categoria extends Zend_Form
{

    public function init()
    {
        
        $this->setMethod('post');

        $nombre = $this->createElement('text', 'nombre');
        $nombre->addFilters(array('StringTrim', 'StripTags'))
                ->addValidators(array(array('StringLength', false, array(3, 100))))
                ->setRequired(true)
                ->setAttrib('class', 'lf')
                ->setLabel('Nombre : ');

        $titulo = $this->createElement('text', 'titulo');
        $titulo->addFilters(array('StringTrim', 'StripTags'))
                ->addValidators(array(array('StringLength', false, array(3, 100))))
                ->setRequired(true)
                ->setAttrib('class', 'lf')
                ->setLabel('Titulo : ');

        $h1 = $this->createElement('text', 'h1');
        $h1->addFilters(array('StringTrim', 'StripTags'))
                ->addValidators(array(array('StringLength', false, array(3, 100))))
                ->setRequired(true)
                ->setAttrib('class', 'lf')
                ->setLabel('Tag H1 :');

        $descripcion = $this->createElement('textarea', 'descripcion');
        $descripcion->addFilters(array('StringTrim', 'StripTags'))
                ->setAttrib('cols', '80')
                ->setAttrib('rows', '10')
                ->setRequired(true)
                ->setAttrib('class', 'st')
                ->setLabel('Descripción :');

        $metaKeywords = $this->createElement('text', 'meta_keywords');
        $metaKeywords->addFilters(array('StringTrim', 'StripTags'))
                 ->addValidators(array(array('StringLength', false, array(3, 100))))
                 ->setRequired(true)
                 ->setAttrib('class', 'lf')
                 ->setLabel('Meta Keywords : ');

        $metaDescripcion = $this->createElement('textarea', 'meta_descripcion');
        $metaDescripcion->addFilters(array('StringTrim', 'StripTags'))
                ->setAttrib('cols', '40')
                ->setAttrib('rows', '5')
                ->setAttrib('class', 'st')
                ->setRequired(true)
                ->setLabel('Meta Descripción :');


        $crear = $this->createElement('submit', 'crear');
        $crear->setRequired(false)
                ->setIgnore(true)
                ->setLabel('Guardar')
                ->setAttrib('class', 'button')
                ->removeDecorator('DtDdWrapper');

        $reestablecer = $this->createElement('reset', 'reset');
        $reestablecer->setRequired(false)
                ->setIgnore(true)
                ->setLabel('Reestablecer')
                ->setAttrib('class', 'button')
                ->removeDecorator('DtDdWrapper');

        $this->addElements(array($nombre,$titulo,$h1,$descripcion,$metaKeywords,$metaDescripcion,$crear,$reestablecer));
        
    }


}

